package com.webex.ta.hydra.hamal.action;

import com.webex.ta.hydra.core.TestResult;
import com.webex.ta.hydra.core.AbstractAction;
import com.webex.ta.hydra.core.ParamDescriptor;
import com.webex.ta.hydra.core.Command;
import com.webex.ta.hydra.hamal.Connections;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-9-6
 * Time: 14:01:02
 */
public class HamalPrepareConnection extends AbstractAction {
    private static final ParamDescriptor[] desc = new ParamDescriptor[3];
    static {
        desc[0] = new ParamDescriptor("connection name");
        desc[1] = new ParamDescriptor("host");
        desc[2] = new ParamDescriptor("port");
    }
    public void execute(TestResult result, String... args) throws Exception {
        Connections.getInstance().prepareConnection(args[0].trim(), args[1], Integer.valueOf(args[2]));
    }

    public ParamDescriptor[] getParamDescriptors(Command cmd) {
        return desc;
    }
}
